class Message {
  constructor(status, message, data) {
    this.status = status;
    this.message = message;
    this.data = data
    this.timestamp = new Date().getTime()
  }
  static success(param) {
    if (typeof param == 'string') {
      return new Message(200, param, null)
    } else if (typeof param == 'object') {
      return new Message(200, 'success', param)
    }
  }
  static error(message) {
    return new Message(500, message, null);
  }
}
module.exports = Message;